<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-1.11.0.min.js"></script>
</head>
<body>
<div><a href="javascript:void(0)" onclick="find1()" >拥有的一类卡</a>
    <a href="javascript:void(0)" onclick="find2()">拥有的二类卡</a></div>

<table id="tab" border="1" width="100%">

</table>
<div>
    <a href="/airong/kaihu1.html" >一类卡开户</a>
    <a href="/airong/kaihu2.html">二类卡开户</a>
</div>
<table width="100%" id="shouye">
    <tr>
        <td align="center"><a href="/airong/index.html">首页</a></td>
        <!--    <td align="center"><a href="#"><input type="button" id="lc" value="理财"></a></td>-->
        <td align="center"><a href="" id="lc">理财</a></td>
        <td align="center"><a href="/airong/personalCenter.html">我的</a></td>

    </tr>
</table>
</body>
<script>
    let urll = "/airong/cc?action=getSessionID";
    let paramsl = {}
    $.get(urll,paramsl,function (sessionID){
        document.getElementById('lc').href= "products.html?uid="+sessionID;
    },"text")

    function find1(){
        let url = "/airong/card?action=findAllCard1";
        let params = {};
        $.get(url,params,function (data){
            $("#tab").html("<tr>\n" +
                "        <th>一类卡卡号</th>" +
                "        <th>姓名</th>" +
                "        <th>手机号</th>" +
                "        <th>开户行</th>" +
                "        <th>所属用户id</th>" +
                "        <th>余额</th>" +
                "        <th>操作</th>" +
                "    </tr>")

            $.each(data,function (idx,card1){
                $("#tab").append("<tr>"+
                    "<td>"+card1.id+"</td>" +
                    "<td>"+card1.name+"</td>" +
                    "<td>"+card1.phone+"</td>" +
                    "<td>"+card1.type+"</td>" +
                    "<td>"+card1.uid+"</td>" +
                    "<td>"+card1.balance+"</td>" +
                    "<td>"+ "<a href='/airong/zhuanzhang.html?id="+card1.id+"&account=1&yue="+card1.balance+"'>去转账</a>"+"&nbsp&nbsp&nbsp" +
                    "</td>"+
                    "</tr>")
            })
        },"json")
    }
    function find2(){
        let url = "/airong/card?action=findAllCard2";
        let params = {};
        $.get(url,params,function (data){
            $("#tab").html("<tr>\n" +
                "        <th>二类卡卡号</th>" +
                "        <th>姓名</th>" +
                "        <th>电话</th>" +
                "        <th>绑定一类卡id</th>" +
                "        <th>所属用户id</th>" +
                "        <th>余额</th>" +
                "        <th>操作</th>" +
                "    </tr>")

            $.each(data,function (idx,card2){
                let c1 = card2.id_C1
                if (c1 == null){
                    $("#tab").append("<tr>"+
                        "<td>"+card2.id+"</td>" +
                        "<td>"+card2.name+"</td>" +
                        "<td>"+card2.phone+"</td>" +
                        "<td>"+"<a href='/airong/bangding.html?id="+card2.id+"'>去绑定一类卡</a>"+"</td>" +
                        "<td>"+card2.uid+"</td>" +
                        "<td>"+card2.balance+"</td>" +
                        "<td>"+"<a href='/airong/tixian.html?id="+card2.id+"'"+">去提现</a>"+"&nbsp&nbsp&nbsp" +
                        "<a href='/airong/chongzhi.html?id="+card2.id+"'>去充值</a>"+"&nbsp&nbsp&nbsp" +
                        "<a href='/airong/zhuanzhang.html?id="+card2.id+"&account=2&yue="+card2.balance+"'>去转账</a>"+
                        "</td>" +
                        "</tr>")
                }else {
                    $("#tab").append("<tr>"+
                        "<td>"+card2.id+"</td>" +
                        "<td>"+card2.name+"</td>" +
                        "<td>"+card2.phone+"</td>" +
                        "<td>"+c1+"</td>" +
                        "<td>"+card2.uid+"</td>" +
                        "<td>"+card2.balance+"</td>" +
                        "<td>"+"<a href='/airong/tixian.html?id="+card2.id+"'>去提现</a>"+"&nbsp&nbsp&nbsp" +
                        "<a href='/airong/chongzhi.html?id="+card2.id+"'>去充值</a>"+"&nbsp&nbsp&nbsp" +
                        "<a href='/airong/zhuanzhang.html?id="+card2.id+"&account=2&yue="+card2.balance+"'>去转账</a>"+
                        "</td>>" +
                        "</tr>")
                }
            })
        },"json")
    }

</script>
<style>
    div {
        width: 100%;
        text-align: center;
    }
    #shouye{
        position: absolute;
        top: 600px;
        padding: 5px;
        margin: 4px;
        background-color: bisque;
        font-size: 20px;
        text-align: center;
        z-index: 1;
    }
    a {
        display: inline-block;
        position: relative;
        z-index: 1;
        padding: 5px;
        margin: 4px;
        background-color: bisque;
        font-size: 20px;
        text-align: center;
        margin:auto
    }

</style>
</html>